<{include file='../common/head.tpl'}>
<script>
//删除
function del(staff_id){
    if (confirm('确定删除？')) 
    {
        $.getJSON('/schedule/del',{staff_id:staff_id},function(res){
            if (res.status==1) {
                alert('操作成功');
                $('#staff_'+staff_id).remove();
                return false;
            }
            alert('操作失败');
        });
    }
    return false;
}

//排班
function schedule(staff_id){
    $.layer({
        type: 2,
        shadeClose: true,
        title: false,
        closeBtn: [0, true],
        shade: [0.8, '#000'],
        border: [0],
        offset: ['150px',''],
        area: ['650px', '300px'],
        iframe: {src: '/schedule/plan?staff_id='+staff_id}
    }); 
}
//排班
function detail(staff_id){
    $.layer({
        type: 2,
        shadeClose: true,
        title: false,
        closeBtn: [0, true],
        shade: [0.8, '#000'],
        border: [0],
        offset: ['150px',''],
        area: ['950px', '200px'],
        iframe: {src: '/schedule/detail?staff_id='+staff_id}
    }); 
}

</script>
<div class="main w1060">
		<div class="pbbg"><a href="/schedule/add">新增员工</a></div>
		
		<div class="biaoge">   
			<table width="100%" border="0" cellspacing="0">
			  <tr>
			  	<td class="btzong3"><strong>姓名</strong></td>
				<td class="btzong3"><strong>岗位</strong></td>
				<td class="btzong3"><strong>工号</strong></td>
				<td class="btzong3"><strong>是否临柜</strong></td>
				<td class="btzong3"><strong>是否调岗</strong></td>
				<td class="btzong3"><strong>调动后岗位</strong></td>
				<td class="btzong3"><strong>调动时间</strong></td>
			    <td class="btzong3"><strong>班次安排</strong></td>
			    <td class="btzong3"><strong>相片</strong></td>
			    <td class="btzong3"><strong>操作</strong></td>
			  </tr>
                          <{foreach $list as $key => $val}>
			  <tr id="staff_<{$val.staff_id}>">
				<td><{$val.staff_name}></td>
                                <td><{$val.station}></td>
				<td><{$val.staff_identifier}></td>
				<td><{if $val.temporary==1}>是<{else}>否<{/if}></td>
				<td><{if $val.shift==1}>是<{else}>否<{/if}></td>
                                <td><{if $val.new_station}><{$val.new_station}><{/if}></td>
				<td><{if $val.shift_time}><{$val.shift_time}><{/if}></td>
                                <td><a href="javascript:;" onclick="detail(<{$val.staff_id}>);">查看排班</a></td>
                                <td><{if $val.photo}><img src="<{$val.photo}>" width="31" height="30" alt="" /><{/if}></td>
                                <td>
                                    <a href="/schedule/add?staff_id=<{$val.staff_id}>">编辑</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="schedule(<{$val.staff_id}>);">排班</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="del(<{$val.staff_id}>);">删除</a>
                                </td>
			  </tr>
                          <{/foreach}>
		  </table>
		</div>
		<div style="float:right;">
			<{$page}>
		</div>
		
</div>
<{include file="../common/footer.tpl"}>